package com.example.administrator.test2;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.LinearLayout;
import android.widget.Toast;


import java.util.List;

public class printf extends AppCompatActivity {
    private List<car>carList;
    private ListView car;
    private Context mcontext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_printf);
        Button mbotton7 = (Button) findViewById(R.id.button7);
        mbotton7.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v){
                Intent intent1=getIntent();
                String timeout=intent1.getStringExtra("TO");
                String number=intent1.getStringExtra("T");
                DatabaseHandler1 dbHelper=new DatabaseHandler1(printf.this,"labcar",null,1);
                EditText etnumber=(EditText) findViewById(R.id.editText);
                EditText timein=(EditText) findViewById(R.id.editText2);
                EditText timeout1=(EditText) findViewById(R.id.editText4);
                car c1=new car();
                dbHelper.getWritableDatabase();
                c1=dbHelper.getCar(number,dbHelper);
                Toast.makeText(mcontext,number,Toast.LENGTH_SHORT).show();
                etnumber.setText(number);
                timein.setText(c1.gettimein());
                timeout1.setText(timeout);
                Intent intent = new Intent();
                intent.setClass(printf.this,function .class);
                startActivity(intent);
            }
        });


    }
}
